package cn.nfwx.tv.model;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by dell on 2017/11/15.
 */

public class TVProgramModel implements Parcelable {
    private String title;
    private long time;
    private String path;
    private int status; // 1、回看 2、正在直播 3、预定 4、下载中 5、下载完成 6、已预约
    private boolean isPlaying;
    private String vsid;
    private String liveId;
    private String liveName;

    public TVProgramModel(Parcel in) {
        title = in.readString();
        time = in.readLong();
        path = in.readString();
        status = in.readInt();
        isPlaying = in.readByte() != 0;
        vsid = in.readString();
        liveId = in.readString();
        liveName = in.readString();
    }

    public TVProgramModel() {

    }

    public static final Creator<TVProgramModel> CREATOR = new Creator<TVProgramModel>() {
        @Override
        public TVProgramModel createFromParcel(Parcel in) {
            return new TVProgramModel(in);
        }

        @Override
        public TVProgramModel[] newArray(int size) {
            return new TVProgramModel[size];
        }
    };

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(title);
        dest.writeLong(time);
        dest.writeString(path);
        dest.writeInt(status);
        dest.writeByte((byte) (isPlaying ? 1 : 0));
        dest.writeString(vsid);
        dest.writeString(liveId);
        dest.writeString(liveName);
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public long getTime() {
        return time;
    }

    public void setTime(long time) {
        this.time = time;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public void setPlaying(boolean playing) {
        isPlaying = playing;
    }

    public boolean isPlaying() {
        return isPlaying;
    }

    public String getVsid() {
        return vsid;
    }

    public void setVsid(String vsid) {
        this.vsid = vsid;
    }

    public String getLiveId() {
        return liveId;
    }

    public void setLiveId(String liveId) {
        this.liveId = liveId;
    }

    public String getLiveName() {
        return liveName;
    }

    public void setLiveName(String liveName) {
        this.liveName = liveName;
    }
}
